﻿Imports System.Data.SqlClient

Public Class cn_companycontact
    Inherits System.Web.UI.Page
    Dim objrd As SqlDataReader = Nothing


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim sSQL As String = ""
        Dim objdt As New GetData
        Dim ps As New PreparedStatement(sSQL)
        Dim strErr As String = ""
        Dim comId As String
        comId = Request("cid")

        If comId <> Nothing And comId <> "" Then
            ps.addParameter("cid", comId)
            sSQL = "select *  from  merchant_info where company_id=@cid and lang_flag='zh'"
            ps.strSql = sSQL
            Dim conn As SqlConnection = objdt.getConn()

            objrd = objdt.dr(ps, strErr, conn, objrd)
            If Not objrd.Read() Then
                objdt.closeConn(conn)
                Exit Sub
            End If
            title.InnerHtml += ":" & objrd.Item("company_name")
            companyName.InnerText = objrd.Item("company_name")
            userName.Text = objrd("linkman").ToString
            c_country.Text = objrd("country").ToString
            c_state.Text = objrd("state").ToString
            c_city.Text = objrd("city").ToString
            c_address.Text = objrd("address").ToString
            cellphone.Text = objrd("cellphone").ToString
            companyPhone.Text = objrd("company_phone").ToString
            companyUrl.Text = objrd("company_url").ToString
            companyFax.Text = objrd("company_fax").ToString
            objdt.closeConn(conn)

        Else
            Response.Redirect("cn_index.aspx")
        End If
    End Sub


End Class